import 'package:json_annotation/json_annotation.dart';

part 'home_kingkong_model.g.dart';

@JsonSerializable(includeIfNull: false)
class HomeKingkongModel {
  HomeKingkongModel(
    this.id,
    this.title,
    this.sectionId,
    this.sectionTitle,
    this.sort,
    this.sectionSort,
    this.isActive,
    this.isDefault,
  );

  @JsonKey(defaultValue: 0)
  int id;
  @JsonKey(defaultValue: '')
  String title;
  @JsonKey(defaultValue: 0)
  int sectionId;
  @JsonKey(defaultValue: '')
  String sectionTitle;
  @JsonKey(defaultValue: 0)
  int sort;
  @JsonKey(defaultValue: 0)
  int sectionSort;
  @JsonKey(defaultValue: false)
  bool isActive;
  @JsonKey(defaultValue: false)
  bool isDefault;

  String get iconPath => 'assets/images/home/home_kingkong_index_$id.png';

  factory HomeKingkongModel.fromJson(Map<String, dynamic> json) =>
      _$HomeKingkongModelFromJson(json);
  Map<String, dynamic> toJson() => _$HomeKingkongModelToJson(this);
}
